{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 项目人：胡兆杰    \n",
    "## 时间：2020/10\n",
    "## 数据源：https://www.liepin.com/zhaopin/\n",
    "# 目标：\n",
    "#### 抓取大学本科毕业生在广东的产品经理职位的就业机会情况，为本科大学生提供关于产品经理的更多就业信息，为毕业生就业提供参考。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 一、抓取本科毕业生在广州产品经理职位的就业情况\n",
    "### 数据来源于猎聘网\n",
    "#### 抓取大学本科毕业生在广州的产品经理职位的就业机会情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <th>大专及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>12-24k·12薪</td>\n",
       "      <td>2020年09月11日</td>\n",
       "      <td>产品开发经理（美妆）</td>\n",
       "      <td>广州</td>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1928668505.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8976814/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>本科及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>15-20k·15薪</td>\n",
       "      <td>2020年09月18日</td>\n",
       "      <td>产品经理（汽车增值服务）</td>\n",
       "      <td>深圳</td>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931831367.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9721447/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>统招本科</th>\n",
       "      <th>5-10年</th>\n",
       "      <td>面议</td>\n",
       "      <td>2020年09月14日</td>\n",
       "      <td>手机战略产品经理</td>\n",
       "      <td>珠海</td>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931678293.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8519520/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>本科及以上</th>\n",
       "      <th>5-10年</th>\n",
       "      <td>18-30k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理（数字化零售方向）</td>\n",
       "      <td>广州</td>\n",
       "      <td>滴普科技</td>\n",
       "      <td>https://www.liepin.com/job/1931703531.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10166945/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>统招本科</th>\n",
       "      <th>经验不限</th>\n",
       "      <td>12-20k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1930995301.shtml</td>\n",
       "      <td>https://www.liepin.com/company/611524/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <th>本科及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>13-18k·13薪</td>\n",
       "      <td>2020年09月19日</td>\n",
       "      <td>产品经理（金融账户）</td>\n",
       "      <td>东莞</td>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1928184653.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9297695/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <th>大专及以上</th>\n",
       "      <th>5-10年</th>\n",
       "      <td>10-20k·15薪</td>\n",
       "      <td>2020年09月19日</td>\n",
       "      <td>产品经理(线材)</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1928161635.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8340931/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <th>大专及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>12-18k·12薪</td>\n",
       "      <td>2020年09月19日</td>\n",
       "      <td>产品运营经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>https://www.liepin.com/job/1928153661.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9833477/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <th>大专及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>15-25k·12薪</td>\n",
       "      <td>2020年09月19日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>https://www.liepin.com/job/1928153623.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9833477/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <th>本科及以上</th>\n",
       "      <th>3-5年</th>\n",
       "      <td>面议</td>\n",
       "      <td>2020年09月19日</td>\n",
       "      <td>图像效果产品经理 — 轻颜</td>\n",
       "      <td>深圳</td>\n",
       "      <td>字节跳动</td>\n",
       "      <td>https://www.liepin.com/job/1928110637.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7863078/</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                         薪水           时间             职称 公司地点            公司名称  \\\n",
       "    edu   经验                                                                   \n",
       "0   大专及以上 3-5年   12-24k·12薪  2020年09月11日     产品开发经理（美妆）   广州    广州昂泰国际贸易有限公司   \n",
       "1   本科及以上 3-5年   15-20k·15薪  2020年09月18日   产品经理（汽车增值服务）   深圳  中保车服科技服务股份有限公司   \n",
       "2   统招本科  5-10年          面议  2020年09月14日       手机战略产品经理   珠海     珠海市魅族科技有限公司   \n",
       "3   本科及以上 5-10年  18-30k·12薪  2020年09月16日  产品经理（数字化零售方向）   广州            滴普科技   \n",
       "4   统招本科  经验不限   12-20k·12薪  2020年09月16日           产品经理   深圳      深圳证券通信有限公司   \n",
       "...                     ...          ...            ...  ...             ...   \n",
       "395 本科及以上 3-5年   13-18k·13薪  2020年09月19日     产品经理（金融账户）   东莞   东莞市彩洋信息科技有限公司   \n",
       "396 大专及以上 5-10年  10-20k·15薪  2020年09月19日       产品经理(线材)   深圳   深圳市沃客非凡科技有限公司   \n",
       "397 大专及以上 3-5年   12-18k·12薪  2020年09月19日         产品运营经理   深圳        AE GROUP   \n",
       "398 大专及以上 3-5年   15-25k·12薪  2020年09月19日           产品经理   深圳        AE GROUP   \n",
       "399 本科及以上 3-5年           面议  2020年09月19日  图像效果产品经理 — 轻颜   深圳            字节跳动   \n",
       "\n",
       "                                                          链结  \\\n",
       "    edu   经验                                                   \n",
       "0   大专及以上 3-5年   https://www.liepin.com/job/1928668505.shtml   \n",
       "1   本科及以上 3-5年   https://www.liepin.com/job/1931831367.shtml   \n",
       "2   统招本科  5-10年  https://www.liepin.com/job/1931678293.shtml   \n",
       "3   本科及以上 5-10年  https://www.liepin.com/job/1931703531.shtml   \n",
       "4   统招本科  经验不限   https://www.liepin.com/job/1930995301.shtml   \n",
       "...                                                      ...   \n",
       "395 本科及以上 3-5年   https://www.liepin.com/job/1928184653.shtml   \n",
       "396 大专及以上 5-10年  https://www.liepin.com/job/1928161635.shtml   \n",
       "397 大专及以上 3-5年   https://www.liepin.com/job/1928153661.shtml   \n",
       "398 大专及以上 3-5年   https://www.liepin.com/job/1928153623.shtml   \n",
       "399 本科及以上 3-5年   https://www.liepin.com/job/1928110637.shtml   \n",
       "\n",
       "                                                    公司URL  \n",
       "    edu   经验                                               \n",
       "0   大专及以上 3-5年    https://www.liepin.com/company/8976814/  \n",
       "1   本科及以上 3-5年    https://www.liepin.com/company/9721447/  \n",
       "2   统招本科  5-10年   https://www.liepin.com/company/8519520/  \n",
       "3   本科及以上 5-10年  https://www.liepin.com/company/10166945/  \n",
       "4   统招本科  经验不限     https://www.liepin.com/company/611524/  \n",
       "...                                                   ...  \n",
       "395 本科及以上 3-5年    https://www.liepin.com/company/9297695/  \n",
       "396 大专及以上 5-10年   https://www.liepin.com/company/8340931/  \n",
       "397 大专及以上 3-5年    https://www.liepin.com/company/9833477/  \n",
       "398 大专及以上 3-5年    https://www.liepin.com/company/9833477/  \n",
       "399 本科及以上 3-5年    https://www.liepin.com/company/7863078/  \n",
       "\n",
       "[400 rows x 7 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 引用pandas基本模块\n",
    "import pandas as pd\n",
    "df_raw = pd.read_csv(\"2020大学本科毕业生在广东关于产品经理的就业情况.tsv\", encoding=\"utf-8\", sep=\"\\t\",\\\n",
    "                 keep_default_na=False, na_values='na_rep',index_col= [0,1,2])\n",
    "display(df_raw)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 二、分进合击出报表\n",
    "#### 简单读档并查看数据框讯息，观察dtypes\n",
    "参考文献：https://www.slidestalk.com/DBAPlus/Application_Practice_of_Distributed_Database_in_Ping_An"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 400 entries, 0 to 399\n",
      "Data columns (total 10 columns):\n",
      " #   Column      Non-Null Count  Dtype \n",
      "---  ------      --------------  ----- \n",
      " 0   Unnamed: 0  400 non-null    int64 \n",
      " 1   edu         400 non-null    object\n",
      " 2   经验          400 non-null    object\n",
      " 3   薪水          400 non-null    object\n",
      " 4   时间          400 non-null    object\n",
      " 5   职称          400 non-null    object\n",
      " 6   公司地点        397 non-null    object\n",
      " 7   公司名称        400 non-null    object\n",
      " 8   链结          400 non-null    object\n",
      " 9   公司URL       329 non-null    object\n",
      "dtypes: int64(1), object(9)\n",
      "memory usage: 31.4+ KB\n"
     ]
    }
   ],
   "source": [
    "# 查看数据类型\n",
    "df = pd.read_csv (\"2020大学本科毕业生在广东关于产品经理的就业情况.tsv\", encoding = \"utf-8\", sep=\"\\t\")\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 获取某列Series的str属性，使用各种字符串处理函数\n",
    "参考文档:https://pandas.pydata.org/pandas-docs/stable/reference/series.html#string-handling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pandas.core.strings.StringMethods at 0x286663d5dc8>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"公司名称\"].str"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 实现字符串的拆分函数 \n",
    "### 观察数据类型   陈列出在广东全部有关产品经理的公司  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0        [广州昂泰国际贸易有限公司]\n",
       "1      [中保车服科技服务股份有限公司]\n",
       "2         [珠海市魅族科技有限公司]\n",
       "3                [滴普科技]\n",
       "4          [深圳证券通信有限公司]\n",
       "             ...       \n",
       "395     [东莞市彩洋信息科技有限公司]\n",
       "396     [深圳市沃客非凡科技有限公司]\n",
       "397          [AE GROUP]\n",
       "398          [AE GROUP]\n",
       "399              [字节跳动]\n",
       "Name: 公司名称, Length: 400, dtype: object"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"公司名称\"].str.split('、')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  0\n",
       "0      广州昂泰国际贸易有限公司\n",
       "1    中保车服科技服务股份有限公司\n",
       "2       珠海市魅族科技有限公司\n",
       "3              滴普科技\n",
       "4        深圳证券通信有限公司\n",
       "..              ...\n",
       "395   东莞市彩洋信息科技有限公司\n",
       "396   深圳市沃客非凡科技有限公司\n",
       "397        AE GROUP\n",
       "398        AE GROUP\n",
       "399            字节跳动\n",
       "\n",
       "[400 rows x 1 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"公司名称\"].str.split('、',expand=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 三、数据框重塑\n",
    "参考资料：https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.aggregate.html\n",
    "\n",
    "#### 把以上公司对产品经理的学历要求和薪水标准做了对比参考"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "      <th>薪水</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "      <td>13-18k·13薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "      <td>10-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>12-18k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               公司名称          薪水\n",
       "序号                             \n",
       "0      广州昂泰国际贸易有限公司  12-24k·12薪\n",
       "1    中保车服科技服务股份有限公司  15-20k·15薪\n",
       "2       珠海市魅族科技有限公司          面议\n",
       "3              滴普科技  18-30k·12薪\n",
       "4        深圳证券通信有限公司  12-20k·12薪\n",
       "..              ...         ...\n",
       "395   东莞市彩洋信息科技有限公司  13-18k·13薪\n",
       "396   深圳市沃客非凡科技有限公司  10-20k·15薪\n",
       "397        AE GROUP  12-18k·12薪\n",
       "398        AE GROUP  15-25k·12薪\n",
       "399            字节跳动          面议\n",
       "\n",
       "[400 rows x 2 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "      <th>edu</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>大专及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>本科及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>统招本科</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "      <td>本科及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>统招本科</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "      <td>本科及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "      <td>大专及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>大专及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>大专及以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "      <td>本科及以上</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               公司名称    edu\n",
       "序号                        \n",
       "0      广州昂泰国际贸易有限公司  大专及以上\n",
       "1    中保车服科技服务股份有限公司  本科及以上\n",
       "2       珠海市魅族科技有限公司   统招本科\n",
       "3              滴普科技  本科及以上\n",
       "4        深圳证券通信有限公司   统招本科\n",
       "..              ...    ...\n",
       "395   东莞市彩洋信息科技有限公司  本科及以上\n",
       "396   深圳市沃客非凡科技有限公司  大专及以上\n",
       "397        AE GROUP  大专及以上\n",
       "398        AE GROUP  大专及以上\n",
       "399            字节跳动  本科及以上\n",
       "\n",
       "[400 rows x 2 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_公司与薪水_准备 =df[[\"公司名称\",\"薪水\"]]\n",
    "df_公司与薪水_准备.index.name=\"序号\"\n",
    "df_公司与薪水 =pd.merge(df_公司与薪水_准备.drop('薪水', axis=1),\\\n",
    "                          df['薪水'].str.split(',', expand=True)\\\n",
    "                                            .stack().reset_index(level=1,drop=True)\n",
    "                                            .rename('薪水'),\\\n",
    "                          on=\"序号\")\n",
    "\n",
    "df_公司与学历_准备 =df[[\"公司名称\",\"edu\"]]\n",
    "df_公司与学历_准备.index.name=\"序号\"\n",
    "df_公司与学历 =pd.merge(df_公司与学历_准备.drop('edu', axis=1),\\\n",
    "                          df['edu'].str.split(',', expand=True)\\\n",
    "                                            .stack().reset_index(level=1,drop=True)\n",
    "                                            .rename('edu'),\\\n",
    "                          on=\"序号\")\n",
    "\n",
    "\n",
    "display(df_公司与薪水)\n",
    "display(df_公司与学历)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "      <th>薪水</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "      <td>13-18k·13薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "      <td>10-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>12-18k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               公司名称          薪水\n",
       "序号                             \n",
       "0      广州昂泰国际贸易有限公司  12-24k·12薪\n",
       "1    中保车服科技服务股份有限公司  15-20k·15薪\n",
       "2       珠海市魅族科技有限公司          面议\n",
       "3              滴普科技  18-30k·12薪\n",
       "4        深圳证券通信有限公司  12-20k·12薪\n",
       "..              ...         ...\n",
       "395   东莞市彩洋信息科技有限公司  13-18k·13薪\n",
       "396   深圳市沃客非凡科技有限公司  10-20k·15薪\n",
       "397        AE GROUP  12-18k·12薪\n",
       "398        AE GROUP  15-25k·12薪\n",
       "399            字节跳动          面议\n",
       "\n",
       "[400 rows x 2 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_公司与薪水_准备 =df[[\"公司名称\",\"薪水\"]]\n",
    "df_公司与薪水_准备"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 先用drop删除一列，然后再用join合并列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               公司名称\n",
       "序号                 \n",
       "0      广州昂泰国际贸易有限公司\n",
       "1    中保车服科技服务股份有限公司\n",
       "2       珠海市魅族科技有限公司\n",
       "3              滴普科技\n",
       "4        深圳证券通信有限公司\n",
       "..              ...\n",
       "395   东莞市彩洋信息科技有限公司\n",
       "396   深圳市沃客非凡科技有限公司\n",
       "397        AE GROUP\n",
       "398        AE GROUP\n",
       "399            字节跳动\n",
       "\n",
       "[400 rows x 1 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_待合并 =df_公司与薪水_准备.drop('薪水', axis=1)\n",
    "df_待合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12-24k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>15-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>18-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>12-20k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>13-18k·13薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>10-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>12-18k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              0\n",
       "序号             \n",
       "0    12-24k·12薪\n",
       "1    15-20k·15薪\n",
       "2            面议\n",
       "3    18-30k·12薪\n",
       "4    12-20k·12薪\n",
       "..          ...\n",
       "395  13-18k·13薪\n",
       "396  10-20k·15薪\n",
       "397  12-18k·12薪\n",
       "398  15-25k·12薪\n",
       "399          面议\n",
       "\n",
       "[400 rows x 1 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['薪水'].str.split(',', expand=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### stack对行进行索引操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "序号\n",
       "0      12-24k·12薪\n",
       "1      15-20k·15薪\n",
       "2              面议\n",
       "3      18-30k·12薪\n",
       "4      12-20k·12薪\n",
       "          ...    \n",
       "395    13-18k·13薪\n",
       "396    10-20k·15薪\n",
       "397    12-18k·12薪\n",
       "398    15-25k·12薪\n",
       "399            面议\n",
       "Length: 400, dtype: object"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['薪水'].str.split(',', expand=True).stack().reset_index(level=1,drop=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 给新的Series命名为“薪水”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "序号\n",
       "0      12-24k·12薪\n",
       "1      15-20k·15薪\n",
       "2              面议\n",
       "3      18-30k·12薪\n",
       "4      12-20k·12薪\n",
       "          ...    \n",
       "395    13-18k·13薪\n",
       "396    10-20k·15薪\n",
       "397    12-18k·12薪\n",
       "398    15-25k·12薪\n",
       "399            面议\n",
       "Name: 薪水, Length: 400, dtype: object"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_准备合并的列 =df['薪水'].str.split(',', expand=True).stack().reset_index(level=1,drop=True).rename('薪水')\n",
    "df_准备合并的列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>序号</th>\n",
       "      <th>薪水</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5</td>\n",
       "      <td>15-30k·13薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>10-15k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>7</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>14-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10</td>\n",
       "      <td>10-15k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>11</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>13</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>14</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>15</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>16</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>17</td>\n",
       "      <td>13-23k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>18</td>\n",
       "      <td>12-18k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>19</td>\n",
       "      <td>8-15k·12薪</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    序号          薪水\n",
       "0    0  12-24k·12薪\n",
       "1    1  15-20k·15薪\n",
       "2    2          面议\n",
       "3    3  18-30k·12薪\n",
       "4    4  12-20k·12薪\n",
       "5    5  15-30k·13薪\n",
       "6    6  10-15k·12薪\n",
       "7    7  20-30k·12薪\n",
       "8    8  14-25k·12薪\n",
       "9    9  15-30k·12薪\n",
       "10  10  10-15k·12薪\n",
       "11  11  15-25k·12薪\n",
       "12  12  20-30k·12薪\n",
       "13  13  15-30k·12薪\n",
       "14  14  15-30k·12薪\n",
       "15  15  15-30k·12薪\n",
       "16  16  15-25k·12薪\n",
       "17  17  13-23k·12薪\n",
       "18  18  12-18k·12薪\n",
       "19  19   8-15k·12薪"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dict_准备合并的列 = {\"序号\":df_准备合并的列.index,\"薪水\":df_准备合并的列.values}\n",
    "df_准备合并列=pd.DataFrame(dict_准备合并的列)\n",
    "df_准备合并列.head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 四、数据框聚合(用merge进行合并)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "      <th>薪水</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>序号</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>滴普科技</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>395</th>\n",
       "      <td>东莞市彩洋信息科技有限公司</td>\n",
       "      <td>13-18k·13薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>396</th>\n",
       "      <td>深圳市沃客非凡科技有限公司</td>\n",
       "      <td>10-20k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>12-18k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>AE GROUP</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>字节跳动</td>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>400 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               公司名称          薪水\n",
       "序号                             \n",
       "0      广州昂泰国际贸易有限公司  12-24k·12薪\n",
       "1    中保车服科技服务股份有限公司  15-20k·15薪\n",
       "2       珠海市魅族科技有限公司          面议\n",
       "3              滴普科技  18-30k·12薪\n",
       "4        深圳证券通信有限公司  12-20k·12薪\n",
       "..              ...         ...\n",
       "395   东莞市彩洋信息科技有限公司  13-18k·13薪\n",
       "396   深圳市沃客非凡科技有限公司  10-20k·15薪\n",
       "397        AE GROUP  12-18k·12薪\n",
       "398        AE GROUP  15-25k·12薪\n",
       "399            字节跳动          面议\n",
       "\n",
       "[400 rows x 2 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_公司与薪水 = pd.merge(df_待合并,df_准备合并的列,on= \"序号\")\n",
    "df_公司与薪水"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 五、初阶分进合击分析\n",
    "### 使用初阶分进合击分析策略  对公司的地点进行了分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>薪水</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公司名称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>58同城</th>\n",
       "      <th>深圳</th>\n",
       "      <td>15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AE GROUP</th>\n",
       "      <th>深圳</th>\n",
       "      <td>12-18k·12薪15-25k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AKULAKU</th>\n",
       "      <th>深圳</th>\n",
       "      <td>25-40k·14薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ALLOVE</th>\n",
       "      <th>深圳</th>\n",
       "      <td>20-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Consumer/Retail</th>\n",
       "      <th>广州</th>\n",
       "      <td>20-40k·15薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>阿里巴巴</th>\n",
       "      <th>广州</th>\n",
       "      <td>面议</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>雷士照明</th>\n",
       "      <th>惠州</th>\n",
       "      <td>10-16k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>靖禾管理咨询(上海)有限公司</th>\n",
       "      <th>深圳</th>\n",
       "      <td>25-40k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马上消费金融股份有限公司</th>\n",
       "      <th>深圳</th>\n",
       "      <td>15-30k·12薪</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>鹏辉能源</th>\n",
       "      <th>珠海</th>\n",
       "      <td>20-40k·14薪20-40k·14薪</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>257 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        薪水\n",
       "公司名称            公司地点                      \n",
       "58同城            深圳              15-25k·12薪\n",
       "AE GROUP        深圳    12-18k·12薪15-25k·12薪\n",
       "AKULAKU         深圳              25-40k·14薪\n",
       "ALLOVE          深圳              20-30k·12薪\n",
       "Consumer/Retail 广州              20-40k·15薪\n",
       "...                                    ...\n",
       "阿里巴巴            广州                      面议\n",
       "雷士照明            惠州              10-16k·12薪\n",
       "靖禾管理咨询(上海)有限公司  深圳              25-40k·12薪\n",
       "马上消费金融股份有限公司    深圳              15-30k·12薪\n",
       "鹏辉能源            珠海    20-40k·14薪20-40k·14薪\n",
       "\n",
       "[257 rows x 1 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv (\"2020大学本科毕业生在广东关于产品经理的就业情况.tsv\", encoding = \"utf-8\", sep=\"\\t\")\n",
    "\n",
    "分进合击初阶 = df.groupby(by= [\"公司名称\", \"公司地点\"]) \\\n",
    "                .agg({\"薪水\":\"sum\"}) \n",
    "分进合击初阶"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(241, 11)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>公司地点</th>\n",
       "      <th>东莞</th>\n",
       "      <th>中山</th>\n",
       "      <th>佛山</th>\n",
       "      <th>广东</th>\n",
       "      <th>广州</th>\n",
       "      <th>惠州</th>\n",
       "      <th>汕头</th>\n",
       "      <th>深圳</th>\n",
       "      <th>珠海</th>\n",
       "      <th>肇庆</th>\n",
       "      <th>阳江</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公司名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>58同城</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AE GROUP</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12-18k·12薪15-25k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AKULAKU</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25-40k·14薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ALLOVE</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Consumer/Retail</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-40k·15薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>阿里巴巴</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>面议</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>雷士照明</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10-16k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>靖禾管理咨询(上海)有限公司</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25-40k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马上消费金融股份有限公司</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>鹏辉能源</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-40k·14薪20-40k·14薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>241 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "公司地点              东莞   中山   佛山   广东          广州          惠州   汕头  \\\n",
       "公司名称                                                               \n",
       "58同城             NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "AE GROUP         NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "AKULAKU          NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "ALLOVE           NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "Consumer/Retail  NaN  NaN  NaN  NaN  20-40k·15薪         NaN  NaN   \n",
       "...              ...  ...  ...  ...         ...         ...  ...   \n",
       "阿里巴巴             NaN  NaN  NaN  NaN          面议         NaN  NaN   \n",
       "雷士照明             NaN  NaN  NaN  NaN         NaN  10-16k·12薪  NaN   \n",
       "靖禾管理咨询(上海)有限公司   NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "马上消费金融股份有限公司     NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "鹏辉能源             NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "\n",
       "公司地点                               深圳                    珠海   肇庆   阳江  \n",
       "公司名称                                                                   \n",
       "58同城                       15-25k·12薪                   NaN  NaN  NaN  \n",
       "AE GROUP         12-18k·12薪15-25k·12薪                   NaN  NaN  NaN  \n",
       "AKULAKU                    25-40k·14薪                   NaN  NaN  NaN  \n",
       "ALLOVE                     20-30k·12薪                   NaN  NaN  NaN  \n",
       "Consumer/Retail                   NaN                   NaN  NaN  NaN  \n",
       "...                               ...                   ...  ...  ...  \n",
       "阿里巴巴                              NaN                   NaN  NaN  NaN  \n",
       "雷士照明                              NaN                   NaN  NaN  NaN  \n",
       "靖禾管理咨询(上海)有限公司             25-40k·12薪                   NaN  NaN  NaN  \n",
       "马上消费金融股份有限公司               15-30k·12薪                   NaN  NaN  NaN  \n",
       "鹏辉能源                              NaN  20-40k·14薪20-40k·14薪  NaN  NaN  \n",
       "\n",
       "[241 rows x 11 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分进合击迸阶pv = df.groupby(by= [\"公司名称\",\"公司地点\"]) \\\n",
    "                  .agg({\"薪水\":\"sum\"}) \\\n",
    "                  .reset_index() \\\n",
    "                  .set_index([\"公司名称\"]) \\\n",
    "                  .pivot(columns=\"公司地点\", values=\"薪水\")\n",
    "print (分进合击迸阶pv.shape)\n",
    "分进合击迸阶pv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(400, 7)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_raw.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 分进合击pivot_table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(241, 11)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>公司地点</th>\n",
       "      <th>东莞</th>\n",
       "      <th>中山</th>\n",
       "      <th>佛山</th>\n",
       "      <th>广东</th>\n",
       "      <th>广州</th>\n",
       "      <th>惠州</th>\n",
       "      <th>汕头</th>\n",
       "      <th>深圳</th>\n",
       "      <th>珠海</th>\n",
       "      <th>肇庆</th>\n",
       "      <th>阳江</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>公司名称</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>58同城</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15-25k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AE GROUP</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12-18k·12薪15-25k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>AKULAKU</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25-40k·14薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ALLOVE</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Consumer/Retail</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-40k·15薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>阿里巴巴</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>面议</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>雷士照明</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10-16k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>靖禾管理咨询(上海)有限公司</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>25-40k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>马上消费金融股份有限公司</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>鹏辉能源</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>20-40k·14薪20-40k·14薪</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>241 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "公司地点              东莞   中山   佛山   广东          广州          惠州   汕头  \\\n",
       "公司名称                                                               \n",
       "58同城             NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "AE GROUP         NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "AKULAKU          NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "ALLOVE           NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "Consumer/Retail  NaN  NaN  NaN  NaN  20-40k·15薪         NaN  NaN   \n",
       "...              ...  ...  ...  ...         ...         ...  ...   \n",
       "阿里巴巴             NaN  NaN  NaN  NaN          面议         NaN  NaN   \n",
       "雷士照明             NaN  NaN  NaN  NaN         NaN  10-16k·12薪  NaN   \n",
       "靖禾管理咨询(上海)有限公司   NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "马上消费金融股份有限公司     NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "鹏辉能源             NaN  NaN  NaN  NaN         NaN         NaN  NaN   \n",
       "\n",
       "公司地点                               深圳                    珠海   肇庆   阳江  \n",
       "公司名称                                                                   \n",
       "58同城                       15-25k·12薪                   NaN  NaN  NaN  \n",
       "AE GROUP         12-18k·12薪15-25k·12薪                   NaN  NaN  NaN  \n",
       "AKULAKU                    25-40k·14薪                   NaN  NaN  NaN  \n",
       "ALLOVE                     20-30k·12薪                   NaN  NaN  NaN  \n",
       "Consumer/Retail                   NaN                   NaN  NaN  NaN  \n",
       "...                               ...                   ...  ...  ...  \n",
       "阿里巴巴                              NaN                   NaN  NaN  NaN  \n",
       "雷士照明                              NaN                   NaN  NaN  NaN  \n",
       "靖禾管理咨询(上海)有限公司             25-40k·12薪                   NaN  NaN  NaN  \n",
       "马上消费金融股份有限公司               15-30k·12薪                   NaN  NaN  NaN  \n",
       "鹏辉能源                              NaN  20-40k·14薪20-40k·14薪  NaN  NaN  \n",
       "\n",
       "[241 rows x 11 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "分进合击迸阶 = df.pivot_table(index= \"公司名称\", columns=\"公司地点\",  \\\n",
    "                 values=\"薪水\", aggfunc=\"sum\") \n",
    "print (分进合击迸阶.shape)\n",
    "分进合击迸阶"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 六、分进合击pivot_table 按薪资排序\n",
    "#### 更多排序参考：https://pandas.pydata.org/pandas-docs/stable/getting_started/basics.html#basics-sorting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['鹏辉能源', '星河互动', '广州宏算信息科技有限公司', '广州奥凯信息咨询有限公司', '广州嘉检医学检测有限公司',\n",
       "       '广州华明狐网络科技有限公司', '广州优盟广告策划有限公司', '广州交通集团物流有限公司', '广州乘值数据科技有限公司', '广和通',\n",
       "       ...\n",
       "       '深圳保宏电子商务综合服务股份有限公司', '深圳优艾智合机器人科技有限公司', '深圳乐木骆科技有限公司', '深圳中维世纪科技有限公司',\n",
       "       '海目星科技', '济南博盾文化传媒有限公司', '洲明科技', '汕头市迪华贸易有限公司', '步步高电子教育', '58同城'],\n",
       "      dtype='object', name='公司名称', length=241)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "排序 = 分进合击迸阶.sum(axis=1).sort_values(ascending=False).index\n",
    "排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>edu</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th></th>\n",
       "      <th>职称</th>\n",
       "      <th></th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "      <td>2020年09月11日</td>\n",
       "      <td>产品开发经理（美妆）</td>\n",
       "      <td>广州</td>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1928668505.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8976814/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "      <td>2020年09月18日</td>\n",
       "      <td>产品经理（汽车增值服务）</td>\n",
       "      <td>深圳</td>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931831367.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9721447/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年09月14日</td>\n",
       "      <td>手机战略产品经理</td>\n",
       "      <td>珠海</td>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931678293.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8519520/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理（数字化零售方向）</td>\n",
       "      <td>广州</td>\n",
       "      <td>滴普科技</td>\n",
       "      <td>https://www.liepin.com/job/1931703531.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10166945/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1930995301.shtml</td>\n",
       "      <td>https://www.liepin.com/company/611524/</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0    edu     经验          薪水                          职称      \\\n",
       "0           0  大专及以上   3-5年  12-24k·12薪  2020年09月11日     产品开发经理（美妆）  广州   \n",
       "1           1  本科及以上   3-5年  15-20k·15薪  2020年09月18日   产品经理（汽车增值服务）  深圳   \n",
       "2           2   统招本科  5-10年          面议  2020年09月14日       手机战略产品经理  珠海   \n",
       "3           3  本科及以上  5-10年  18-30k·12薪  2020年09月16日  产品经理（数字化零售方向）  广州   \n",
       "4           4   统招本科   经验不限  12-20k·12薪  2020年09月16日           产品经理  深圳   \n",
       "\n",
       "             公司名称                                           链结  \\\n",
       "0    广州昂泰国际贸易有限公司  https://www.liepin.com/job/1928668505.shtml   \n",
       "1  中保车服科技服务股份有限公司  https://www.liepin.com/job/1931831367.shtml   \n",
       "2     珠海市魅族科技有限公司  https://www.liepin.com/job/1931678293.shtml   \n",
       "3            滴普科技  https://www.liepin.com/job/1931703531.shtml   \n",
       "4      深圳证券通信有限公司  https://www.liepin.com/job/1930995301.shtml   \n",
       "\n",
       "                                      公司URL  \n",
       "0   https://www.liepin.com/company/8976814/  \n",
       "1   https://www.liepin.com/company/9721447/  \n",
       "2   https://www.liepin.com/company/8519520/  \n",
       "3  https://www.liepin.com/company/10166945/  \n",
       "4    https://www.liepin.com/company/611524/  "
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 简化栏位变数名称\n",
    "df = pd.read_csv (\"2020大学本科毕业生在广东关于产品经理的就业情况.tsv\", encoding = \"utf-8\", sep=\"\\t\")\n",
    "df.columns = [x.replace(' Name','').replace('时间','').replace('公司地点','')  for x in df.columns]\n",
    "需求情况=df.copy()\n",
    "需求情况.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 七、pyecharts动态地图展示\n",
    "#### 交互式地理图表：https://pyecharts.org/#/zh-cn/geography_charts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>产品经理</th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>edu</th>\n",
       "      <th></th>\n",
       "      <th>薪水</th>\n",
       "      <th></th>\n",
       "      <th>产品经理</th>\n",
       "      <th>位置</th>\n",
       "      <th>单位</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>12-24k·12薪</td>\n",
       "      <td>2020年09月11日</td>\n",
       "      <td>产品开发经理（美妆）</td>\n",
       "      <td>广州</td>\n",
       "      <td>广州昂泰国际贸易有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1928668505.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8976814/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>15-20k·15薪</td>\n",
       "      <td>2020年09月18日</td>\n",
       "      <td>产品经理（汽车增值服务）</td>\n",
       "      <td>深圳</td>\n",
       "      <td>中保车服科技服务股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931831367.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9721447/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年09月14日</td>\n",
       "      <td>手机战略产品经理</td>\n",
       "      <td>珠海</td>\n",
       "      <td>珠海市魅族科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1931678293.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8519520/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>18-30k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理（数字化零售方向）</td>\n",
       "      <td>广州</td>\n",
       "      <td>滴普科技</td>\n",
       "      <td>https://www.liepin.com/job/1931703531.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10166945/</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>12-20k·12薪</td>\n",
       "      <td>2020年09月16日</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>深圳</td>\n",
       "      <td>深圳证券通信有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1930995301.shtml</td>\n",
       "      <td>https://www.liepin.com/company/611524/</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "产品经理  Unnamed: 0    edu                 薪水                        产品经理  位置  \\\n",
       "0              0  大专及以上   3-5年  12-24k·12薪  2020年09月11日     产品开发经理（美妆）  广州   \n",
       "1              1  本科及以上   3-5年  15-20k·15薪  2020年09月18日   产品经理（汽车增值服务）  深圳   \n",
       "2              2   统招本科  5-10年          面议  2020年09月14日       手机战略产品经理  珠海   \n",
       "3              3  本科及以上  5-10年  18-30k·12薪  2020年09月16日  产品经理（数字化零售方向）  广州   \n",
       "4              4   统招本科   经验不限  12-20k·12薪  2020年09月16日           产品经理  深圳   \n",
       "\n",
       "产品经理              单位                                           链结  \\\n",
       "0       广州昂泰国际贸易有限公司  https://www.liepin.com/job/1928668505.shtml   \n",
       "1     中保车服科技服务股份有限公司  https://www.liepin.com/job/1931831367.shtml   \n",
       "2        珠海市魅族科技有限公司  https://www.liepin.com/job/1931678293.shtml   \n",
       "3               滴普科技  https://www.liepin.com/job/1931703531.shtml   \n",
       "4         深圳证券通信有限公司  https://www.liepin.com/job/1930995301.shtml   \n",
       "\n",
       "产品经理                                     公司URL  \n",
       "0      https://www.liepin.com/company/8976814/  \n",
       "1      https://www.liepin.com/company/9721447/  \n",
       "2      https://www.liepin.com/company/8519520/  \n",
       "3     https://www.liepin.com/company/10166945/  \n",
       "4       https://www.liepin.com/company/611524/  "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 简化栏位变数名称\n",
    "df = pd.read_csv (\"2020大学本科毕业生在广东关于产品经理的就业情况.tsv\", encoding = \"utf-8\", sep=\"\\t\")\n",
    "df.columns = [x.replace('职称','产品经理').replace('经验','')\\\n",
    "               .replace('公司名称','单位')\\\n",
    "               .replace('公司地点','位置')\\\n",
    "               .replace('时间','')\\\n",
    "                for x in df.columns]\n",
    "产品经理=df.copy()\n",
    "产品经理.columns.name = \"产品经理\"\n",
    "产品经理.head()\n",
    "产品经理.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 排列得出在广东个市区的公司分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'东莞': 29,\n",
       " '中山': 9,\n",
       " '佛山': 22,\n",
       " '广东': 1,\n",
       " '广州': 103,\n",
       " '惠州': 6,\n",
       " '汕头': 1,\n",
       " '深圳': 219,\n",
       " '珠海': 5,\n",
       " '肇庆': 1,\n",
       " '阳江': 1}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "产品经理_广东地区 =  产品经理.groupby(\"位置\").agg({\"产品经理\":\"count\",\"薪水\":\"sum\"}).rename(columns={\"产品经理\":\"数量\"})\n",
    "产品经理_广东地区.数量.to_dict() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', '广东':'https://assets.pyecharts.org/assets/maps/guangdong'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"b645930a12e8436d969b5fbd8be1fef3\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', '广东'], function(echarts) {\n",
       "                var chart_b645930a12e8436d969b5fbd8be1fef3 = echarts.init(\n",
       "                    document.getElementById('b645930a12e8436d969b5fbd8be1fef3'), 'white', {renderer: 'canvas'});\n",
       "                var option_b645930a12e8436d969b5fbd8be1fef3 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"\\u4ea7\\u54c1\\u7ecf\\u7406\\u516c\\u53f8\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u4e1c\\u839e\",\n",
       "                    \"value\": [\n",
       "                        113.75,\n",
       "                        23.04,\n",
       "                        29\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e2d\\u5c71\",\n",
       "                    \"value\": [\n",
       "                        113.38,\n",
       "                        22.52,\n",
       "                        9\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4f5b\\u5c71\",\n",
       "                    \"value\": [\n",
       "                        113.11,\n",
       "                        23.05,\n",
       "                        22\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        1\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        103\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u60e0\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        114.4,\n",
       "                        23.09,\n",
       "                        6\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c55\\u5934\",\n",
       "                    \"value\": [\n",
       "                        116.69,\n",
       "                        23.39,\n",
       "                        1\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6df1\\u5733\",\n",
       "                    \"value\": [\n",
       "                        114.07,\n",
       "                        22.62,\n",
       "                        219\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u73e0\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        113.52,\n",
       "                        22.3,\n",
       "                        5\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8087\\u5e86\",\n",
       "                    \"value\": [\n",
       "                        112.44,\n",
       "                        23.05,\n",
       "                        1\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9633\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        111.95,\n",
       "                        21.85,\n",
       "                        1\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u4ea7\\u54c1\\u7ecf\\u7406\\u516c\\u53f8\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u4ea7\\u54c1\\u7ecf\\u7406\\u516c\\u53f8\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u4ea7\\u54c1\\u7ecf\\u7406\\u516c\\u53f8\\u5728\\u5e7f\\u4e1c\\u7684\\u5206\\u5e03\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"\\u5e7f\\u4e1c\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_b645930a12e8436d969b5fbd8be1fef3.setOption(option_b645930a12e8436d969b5fbd8be1fef3);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x2867641ec88>"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Geo\n",
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.globals import ChartType, SymbolType\n",
    "\n",
    "country = 产品经理_广东地区.index\n",
    "data_PM = [(k,v) for k,v in 产品经理_广东地区.数量.to_dict().items()]\n",
    "def map_base() -> Geo:\n",
    "    c = (\n",
    "        Geo()\n",
    "        .add_schema(maptype=\"广东\")\n",
    "        .add(\"产品经理公司\", data_PM)\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "        .set_global_opts(\n",
    "            visualmap_opts=opts.VisualMapOpts(),\n",
    "            title_opts=opts.TitleOpts(title=\"产品经理公司在广东的分布\"),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "分布示例 = map_base()\n",
    "分布示例.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 价值宣言\n",
    "\n",
    "#### 鉴于目前许多大学生对就业问题了解较少，对未来毕业就业存在迷惑，对社会的发展有不良影响。我们为此立足于本科毕业生的需要，抓取大学本科毕业生在广州的产品经理职位的就业机会情况，为本科大学生提供关于产品经理的更多就业情况、公司要求、市场需求等信息，为毕业生就业提供参考。\n",
    "\n",
    "#### 根据数据可以分析得到：产品经理这个职位在广东是比较热门的，正呈上升趋势；有近400个公司都需要产品经理的人才。其中大公司也占据了一半，学历大多数是在本科及以上的学历，这给了毕业生一定的机会和机遇。\n",
    "\n",
    "#### 不过也意味着本科毕业生要想在广东产品经理这个职位上就业还是拥有较多的机会的，但是想获得大公司的认可或者更进一步，还是有一定压力的，这更需要毕业生们付出更多的努力。\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
